<template>
  <scroll class="content" id="moveContent">
    <ul>
      <div class="movieList">
        <li v-for="item in movieList" :key="item.filmId">
          <div class="pic_show">
            <img :src="item.poster" />
          </div>
          <div class="info_list">
            <h2>
              {{ item.name }}
              <span class="type">{{ item.item.name }}</span>
            </h2>
            <p v-if="item.grade">
              观众评
              <span class="grade">{{ item.grade }}</span>
            </p>
            <p>
              主演:
              <span
                class="actor"
                v-for="(value, index) in item.actors"
                :key="index"
              >{{ value.name }}</span>
            </p>
            <p>
              <span style="margin-right:8px">{{ item.nation }}</span> |
              <span>{{ item.runtime }}分钟</span>
            </p>
          </div>
          <div class="btn_mall">购票</div>
        </li>
      </div>
    </ul>
  </scroll>
</template>

<script>
export default {
  name: "movie-list",
  data() {
    return {
      movieList: [],
    };
  },
  created() {
    this.axios({
      url:
        "https://m.maizuo.com/gateway?cityId=310100&pageNum=1&pageSize=10&type=1&k=9983752",
      headers: {
        "X-Client-Info":
          '{"a":"3000","ch":"1002","v":"5.0.4","e":"1599439552343623153483778","bc":"310100"}',
        "X-Host": "mall.film-ticket.film.list",
      },
    }).then((res) => {
      this.movieList = res.data.data.films;
      console.log(this.movieList);
    });
  },
};
</script>

<style lang="scss" scoped>
.movieList {
  background-color: #fff;
  margin-top: -10px;
  padding-top: 7px;
  overflow: hidden;
}
.goodsWrap {
  background-color: #fff;
  padding-left: 12px;
}
.movieList ul {
  overflow: hidden;
  background-color: #fff;
}
.actor {
  margin: 0 3px;
}
.movieList ul li {
  border: 1px solid transparent;
  margin: 12px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px #e6e6e6 solid;
  padding-bottom: 10px;
}
.movieList .pic_show {
  width: 64px;
  height: 90px;
}
.movieList .pic_show img {
  width: 100%;
}
.movieList .info_list {
  margin-left: 10px;
  flex: 1;
  position: relative;
  .type {
    font-size: 12px;
    color: #fff;
    background-color: #d2d6dc;
    border-radius: 20%;
    padding: 0 5px;
    margin-left: 10px;
  }
}
.movieList .info_list h2 {
  font-size: 17px;
  line-height: 24px;
  width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.movieList .info_list p {
  font-size: 13px;
  color: #666;
  line-height: 22px;
  width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.movieList .info_list .grade {
  font-weight: 700;
  color: #faaf00;
  font-size: 15px;
}
.movieList .info_list img {
  width: 50px;
  position: absolute;
  right: 10px;
  top: 5px;
}
.movieList .btn_mall,
.movieList .btn_pre {
  width: 47px;
  height: 27px;
  line-height: 28px;
  text-align: center;
  background-color: #f03d37;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.movieList .btn_pre {
  background-color: #3c9fe6;
}
.movieList .pullDown {
  margin: 0;
  padding: 0;
  border: none;
}
#moveContent {
  width: 100%;
  position: absolute;
  top: 260px;
  bottom: 0;
  left: 0;
}
</style>
